package com.qzxy.premiumhotelsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qzxy.premiumhotelsystem.domain.dto.RoomProDTO;
import com.qzxy.premiumhotelsystem.domain.dto.RoomStockPageDTO;
import com.qzxy.premiumhotelsystem.domain.dto.RoomsPageDTO;
import com.qzxy.premiumhotelsystem.domain.entity.Rooms;
import com.qzxy.premiumhotelsystem.domain.vo.RoomTypeCount;
import com.qzxy.premiumhotelsystem.domain.vo.RoomsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 14912
* @description 针对表【rooms】的数据库操作Mapper
* @createDate 2024-09-12 15:55:14
* @Entity com.qzxy.premiumhotelsystem.domain.pojo.Rooms
*/
@Mapper
public interface RoomsMapper extends BaseMapper<Rooms> {

    IPage<RoomsVO> pageQueryWithRoomType(IPage<RoomsVO> page, @Param("dto") RoomsPageDTO roomsPageDTO);

    RoomsVO selectRoomVO(Integer roomId);


    List<RoomTypeCount> countRooms();


    /**
     * 查询所有
     * @return
     */
    @Select("select rooms.*,room_types.* from rooms " +
            "left join room_types " +
            "on rooms.room_type_id = room_types.room_type_id ")
    List<RoomProDTO> allList();
}




